package org.greyhawk.samonitor.domain;

import java.lang.String;
import java.lang.SuppressWarnings;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import org.greyhawk.samonitor.domain.Site;

privileged aspect Resources_Roo_Finder {
    
    @SuppressWarnings("unchecked")
    public static Query Resources.findResourcesesBySummary(String summary) {
        if (summary == null || summary.length() == 0) throw new IllegalArgumentException("The summary argument is required");
        EntityManager em = Resources.entityManager();
        Query q = em.createQuery("SELECT Resources FROM Resources AS resources WHERE resources.summary = :summary");
        q.setParameter("summary", summary);
        return q;
    }
    
    @SuppressWarnings("unchecked")
    public static Query Resources.findResourcesesBySite(Site site) {
        if (site == null) throw new IllegalArgumentException("The site argument is required");
        EntityManager em = Resources.entityManager();
        Query q = em.createQuery("SELECT Resources FROM Resources AS resources WHERE resources.site = :site");
        q.setParameter("site", site);
        return q;
    }
    
}
